package com.ll.wechat.base.utils.widget;

import com.ll.wechat.R;
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

/**
 * 进度加载对话框
 * 
 * 解决Dialog圆角边框问题
 * 
 * @ClassName: LoadingDialog
 * @author yeliangliang
 * @date 2015-7-28 上午10:04:41
 */
public class LoadingDialog extends Dialog {

	public LoadingDialog(Context context, String str) {
		super(context, R.style.dialog);// 自定义的Style
		setCanceledOnTouchOutside(false);// 外点击不消失
		View view = LayoutInflater.from(context).inflate(R.layout.view_loading, null);
		TextView tv = (TextView) view.findViewById(R.id.tv_content);
		tv.setText(str);
		setContentView(view);
	}

	/**
	 * 显示对话框
	 * 
	 * @author yeliangliang
	 * @date 2015-7-28 下午2:48:37
	 * @version V1.0
	 * @return void
	 */
	public void showDialog() {
		if (!isShowing()) {
			this.show();
		}
	}
}
